package com.jams.goodox.entity;

import android.content.Context;

import com.jams.goodox.R;
import com.jams.goodox.net.BaseEntity;

import java.util.List;

/**
 * Created by Jin on 2016/8/12.
 * Description
 */
public class Bill extends BaseEntity {
	/**
	 * pageInfo : {"curPage":1,"hasMore":false,"pageSize":10,"total":0}
	 * resultList : [{"id":"00576927-2620-11e6-aa2b-00163e005381","intime":"2016-05-30 12:35","moneyChange":0.01,"moneyType":"1","subName":"21","type":"2"},{"id":"0018e2f2-261a-11e6-aa2b-00163e005381","intime":"2016-05-30 11:52","moneyChange":0.01,"moneyType":"1","subName":"21","type":"2"},{"id":"005bb4d6-261a-11e6-aa2b-00163e005381","intime":"2016-05-30 11:52","moneyChange":0.01,"moneyType":"1","subName":"21","type":"2"},{"id":"002980cd-2614-11e6-aa2b-00163e005381","intime":"2016-05-30 11:10","moneyChange":0.01,"moneyType":"1","subName":"21","type":"2"}]
	 */
	private DataBean data;

	public DataBean getData() {
		return data;
	}

	public void setData(DataBean data) {
		this.data = data;
	}

	public static class DataBean {
		/**
		 * curPage : 1
		 * hasMore : false
		 * pageSize : 10
		 * total : 0
		 */

		private PageInfoBean pageInfo;
		/**
		 * id : 00576927-2620-11e6-aa2b-00163e005381
		 * intime : 2016-05-30 12:35
		 * moneyChange : 0.01
		 * moneyType : 1
		 * subName : 21
		 * type : 2
		 */

		private List<ResultListBean> resultList;
		private String date;

		public String getDate() {
			return date;
		}

		public void setDate(String date) {
			this.date = date;
		}

		public PageInfoBean getPageInfo() {
			return pageInfo;
		}

		public void setPageInfo(PageInfoBean pageInfo) {
			this.pageInfo = pageInfo;
		}

		public List<ResultListBean> getResultList() {
			return resultList;
		}

		public void setResultList(List<ResultListBean> resultList) {
			this.resultList = resultList;
		}

		public static class PageInfoBean {
			private int curPage;
			private boolean hasMore;
			private int pageSize;
			private int total;

			public int getCurPage() {
				return curPage;
			}

			public void setCurPage(int curPage) {
				this.curPage = curPage;
			}

			public boolean isHasMore() {
				return hasMore;
			}

			public void setHasMore(boolean hasMore) {
				this.hasMore = hasMore;
			}

			public int getPageSize() {
				return pageSize;
			}

			public void setPageSize(int pageSize) {
				this.pageSize = pageSize;
			}

			public int getTotal() {
				return total;
			}

			public void setTotal(int total) {
				this.total = total;
			}
		}

		public static class ResultListBean {
			private String id;
			private String intime;
			private String moneyChange;
			private String moneyChangeStr;
			private int moneyType;
			private String subName;
			private int type;
			private int specialType;
			private String subPic;

			public String getPayType(Context context) {
				switch (moneyType) {
					case 1:
						return "支付宝";
					case 2:
						return "银联";
					case 3:
						return "微信";
					case 4:
						return "一网通";
					case 5:
						return "账户余额";
					case 9:
						return "在线支付";
					case 10:
						return  context.getResources().getString(R.string.zi_jin) + "充值卡";
					case 0:
						return "线下支付";
					default:
						return "账户余额";
				}
			}

			public String getParseDate() {
				if (intime != null) {
					String[] s = intime.split("-");
					if (s.length >= 2)
						return s[0] + s[1];
					return "";
				}
				return "";
			}

			public String getDate1() {
				if (intime != null) {
					String[] s = intime.split(" ")[0].split("-");
					if (s.length >= 2)
						return s[1] + "-" + s[2];
					return "";
				}
				return "";
			}

			public String getDate2() {
				if (intime != null) {
					String[] s = intime.split(" ");
					if (s.length == 2)
						return s[1];
				}
				return "";
			}

			public String getMoneyChangeStr() {
				return moneyChangeStr;
			}

			public void setMoneyChangeStr(String moneyChangeStr) {
				this.moneyChangeStr = moneyChangeStr;
			}

			public String getSubPic() {
				return subPic;
			}

			public void setSubPic(String subPic) {
				this.subPic = subPic;
			}

			public String getId() {
				return id;
			}

			public void setId(String id) {
				this.id = id;
			}

			public String getIntime() {
				return intime;
			}

			public void setIntime(String intime) {
				this.intime = intime;
			}

			public String getMoneyChange() {
				return moneyChange;
			}

			public void setMoneyChange(String moneyChange) {
				this.moneyChange = moneyChange;
			}

			public int getMoneyType() {
				return moneyType;
			}

			public void setMoneyType(int moneyType) {
				this.moneyType = moneyType;
			}

			public String getSubName() {
				return subName;
			}

			public void setSubName(String subName) {
				this.subName = subName;
			}

			public int getType() {
				return type;
			}

			public void setType(int type) {
				this.type = type;
			}

			public int getSpecialType() {
				return specialType;
			}

			public void setSpecialType(int specialType) {
				this.specialType = specialType;
			}
		}
	}
}
